let arr = [

    { comment_id: 76, user_id: 42, comment_date: "05-14", comment_content: "你好", parent_id: null },
    { comment_id: 78, user_id: 42, comment_date: "05-14", comment_content: "你也好", parent_id: "76" },
    { comment_id: 79, user_id: 42, comment_date: "05-14", comment_content: "你也是", parent_id: "78" },
    { comment_id: 80, user_id: 42, comment_date: "05-14", comment_content: "你也一样", parent_id: "79" },
    { comment_id: 81, user_id: 42, comment_date: "05-14", comment_content: "大家都好", parent_id: "80" },
    { comment_id: 82, user_id: 391, comment_date: "05-14", comment_content: "大家都一样", parent_id: "81" },
    { comment_id: 83, user_id: 42, comment_date: "05-14", comment_content: "", parent_id: null },
    { comment_id: 85, user_id: 487, comment_date: "05-14", comment_content: "我也觉得是", parent_id: "82" },
    { comment_id: 86, user_id: 487, comment_date: "05-14", comment_content: "不太一样", parent_id: "81" },
    { comment_id: 87, user_id: 391, comment_date: "05-14", comment_content: "哈哈哈", parent_id: "85" },
    { comment_id: 90, user_id: 548, comment_date: "05-15", comment_content: "D", parent_id: null },
    { comment_id: 93, user_id: 578, comment_date: "05-16", comment_content: "11111", parent_id: null },
    { comment_id: 94, user_id: 578, comment_date: "05-16", comment_content: "111111", parent_id: null },
    { comment_id: 95, user_id: 578, comment_date: "05-16", comment_content: "大家的bilibili做的怎么样了", parent_id: null },
    { comment_id: 103, user_id: 662, comment_date: "05-16", comment_content: "xcczzczxc", parent_id: "95" },
    { comment_id: 111, user_id: 229, comment_date: "05-17", comment_content: "giaogiao", parent_id: "78" },
    { comment_id: 112, user_id: 229, comment_date: "05-17", comment_content: "有点懵", parent_id: "95" },
    { comment_id: 113, user_id: 229, comment_date: "05-17", comment_content: "你好啊", parent_id: "79" },
    { comment_id: 114, user_id: 229, comment_date: "05-17", comment_content: "你好", parent_id: "86" },
    { comment_id: 115, user_id: 229, comment_date: "05-17", comment_content: "好好", parent_id: "114" },
    { comment_id: 116, user_id: 229, comment_date: "05-17", comment_content: "2020-8-17,加油", parent_id: null },
    {comment_id: 117, user_id: 2537, comment_date: "06-10", comment_content: "加油，奥利给", parent_id:"116"}
]

let arr1 = []

for(var i = 0; i<arr.length;i++){
    if(arr[i].parent_id == null){
        arr1.push(arr[i])

        for(var j = 0; j<arr.length;j++){
            if(arr[i].comment_id == arr[j].parent_id){
                arr[i].child = [ arr[j] ]
            }
        }

    }


}

console.log(arr1);

// [
//     { comment_id: 76, user_id: 42, comment_date: "05-14", comment_content: "你好", parent_id: null, child:[//一级评论
//         { comment_id: 78, user_id: 42, comment_date: "05-14", comment_content: "你也好", parent_id: "76",child:[//二级
//             { comment_id: 79, user_id: 42, comment_date: "05-14", comment_content: "你也是", parent_id: "78",child:[//三级
//                 { comment_id: 80, user_id: 42, comment_date: "05-14", comment_content: "你也一样", parent_id: "79" }//四级
//             ] }
//         ] }
//     ] }

// ]